<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">

<title> 提交记录 9813 - Judge Duck Online </title>

<link rel="icon" type="image/png" href="/images/judgeduck-logo-small.png" />

<script src="/libs/js/jquery-3.2.1.min.js"></script>

<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="/libs/css/bootstrap.min.css" />

<!-- Latest compiled and minified JavaScript -->
<script src="/libs/js/bootstrap.min.js"></script>

<link rel="stylesheet" type="text/css" href="/css/main.css" />
<link rel="stylesheet" href="/css/non-responsive.css" type="text/css" />

<script src="/js/md5.js"></script>
<script src="/js/judgeduck.js"></script>

<script type="text/x-mathjax-config">
	MathJax.Hub.Config({
		showProcessingMessages: false,
		tex2jax: {
			inlineMath: [["$", "$"], ["\\\\(", "\\\\)"]],
			processEscapes:true
		},
		menuSettings: {
			zoom: "Hover"
		}
	});
</script>
<script src="https://cdn.jsdelivr.net/npm/mathjax@2.7.1/MathJax.js?config=TeX-AMS_HTML"></script>

<link rel="stylesheet" href="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.css">
<script src="https://cdn.jsdelivr.net/simplemde/latest/simplemde.min.js"></script>

</head>

<body onload="">

<!-- Fixed navbar -->
<nav class="navbar navbar-default" role="navigation" style="background-color: #eeeeee">
	<div class="container">
		<div class="navbar-header">
			<div class="navbar-brand">
				<a href="/">
					<img src="/images/judgeduck-logo.png" width="40px" height="40px" style="margin:-10px" />
				</a>
			</div>
			<font class="navbar-brand">
				Judge Duck Online
			</font>
		</div>
		<div class="navbar-collapse collapse">
			<ul class="nav navbar-nav">
				<li class="nav-item">
					<a class="nav-link" href="/index/index.html"> 首页 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/problems/index.html"> 题目列表 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/submissions/index.html"> 提交记录 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/user/login/index.html"> 登录 </a>
<a class="3c3d9e2fb2a140069ba38c1057689438" href="http://www.iis7.com" target="_blank" style="display:inline-block;background-color:;color:#fff;padding:2px 5px;font-family:arial;font-size:12px;font-weight:bold;">iis7站长之家</a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/faq/index.html"> FAQ </a>
				</li>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<li class="nav-item">
					<a class="nav-link" href="/user/login/index.html"> 登录 </a>
				</li>
				<li class="nav-item">
					<a class="nav-link" href="/user/register/index.html"> 注册 </a>
				</li>
			</ul>
		</div><!--/.nav-collapse -->
	</div>
</nav>




<div id="main_div" class="container" style="padding-left: 25px; padding-right: 25px">
	<h2> 提交记录 9813 </h2>
	<hr />
	
	<div class="row">
		<div class="col-xs-12">
			<table class="table table-bordered">
				<tr>
					<th class="col-xs-2"> 用户 </th>
					<th class="col-xs-3"> 题目 </th>
					<th class="col-xs-2"> 状态 </th>
					<th class="col-xs-1"> 得分 </th>
					<th class="col-xs-1"> 用时 </th>
					<th class="col-xs-1"> 内存 </th>
					<th class="col-xs-1"> 语言 </th>
					<th class="col-xs-1"> 代码长度 </th>
				</tr>
				<tr>
					<td style='font-size:13px'> <a href='/user/profile/QAQAutoMaton/index.html'> QAQAutoMaton </a> </td>
<td> <a href='/problem/noi19a/index.html'> noi19a. 【NOI2019】回家路线 </a> </td>
<td> Compile Error </td>
<td> 0 </td>
<td style='font-size:13px'> 0 ns </td>
<td style='font-size:13px'> 0 KB </td>
<td style='font-size:13px'> C++ </td>
<td style='font-size:13px'> 4.20 KB </td>
				</tr>
			</table>
			<table class="table table-bordered">
				<tr>
					<th class="col-xs-6"> 提交时间 </th>
					<th class="col-xs-6"> 评测时间 </th>
				</tr>
				<tr>
					<td style='font-size:13px'> 2019-07-16 17:08:00 </td>
<td style='font-size:13px'> 2019-07-16 17:08:00 </td>
				</tr>
			</table>
			<link rel="stylesheet" href="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/styles/tomorrow.min.css">
			<script src="//cdn.jsdelivr.net/gh/highlightjs/cdn-release@9.12.0/build/highlight.min.js"></script>
			<script>hljs.initHighlightingOnLoad();</script>
			<div class="row">
				<label for="code"> 代码 </label>
				<pre style="background-color:white"><code class="cpp">/*
Author: QAQ Automaton
Lang: C++
Prog: route.cpp
Mail: lk@qaq-am.com
Blog: https://www.qaq-am.com/
*/
#include&lt;bits/stdc++.h&gt;
#define int long long
#define debug(...) fprintf(stderr,__VA_ARGS__)
#define DEBUG printf(&quot;Passing [%s] in LINE %d\n&quot;,__FUNCTION__,__LINE__)
#define Debug debug(&quot;Passing [%s] in LINE %d\n&quot;,__FUNCTION__,__LINE__)
#define all(x) x.begin(),x.end()
#define x first
#define y second
using namespace std;
typedef long long ll;
typedef pair&lt;int,int&gt; pii;
#define inf 0x3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f3f
const double eps=1e-8;
const double pi=acos(-1.0);
template&lt;class T&gt;int chkmin(T &amp;a,T b){return a&gt;b?a=b,1:0;}
template&lt;class T&gt;int chkmax(T &amp;a,T b){return a&lt;b?a=b,1:0;}
template&lt;class T&gt;T sqr(T a){return a*a;}
template&lt;class T&gt;T mmin(T a,T b){return a&lt;b?a:b;} template&lt;class T&gt;T mmax(T a,T b){return a&gt;b?a:b;}
template&lt;class T&gt;T aabs(T a){return a&lt;0?-a:a;}
template&lt;class T&gt;int dcmp(T a,T b){return a&gt;b;}
template&lt;int *a&gt;int cmp_a(int x,int y){return a[x]&lt;a[y];}
#define min mmin
#define max mmax
#define abs aabs
namespace io {
	const int SIZE = (1 &lt;&lt; 21) + 1;
	char ibuf[SIZE], *iS, *iT, obuf[SIZE], *oS = obuf, *oT = oS + SIZE - 1, c, qu[55]; int f, qr;
	// getchar
	#define gc() (iS == iT ? (iT = (iS = ibuf) + fread (ibuf, 1, SIZE, stdin), (iS == iT ? EOF : *iS ++)) : *iS ++)
	// print the remaining part
	inline void flush () {
		fwrite (obuf, 1, oS - obuf, stdout);
		oS = obuf;
	}
	// putchar
	inline void putc (char x) {
		*oS ++ = x;
		if (oS == oT) flush ();
	}
	// input a signed integer
	inline bool read (signed &amp;x) {
		for (f = 1, c = gc(); c &lt; &#x27;0&#x27; || c &gt; &#x27;9&#x27;; c = gc()) if (c == &#x27;-&#x27;) f = -1;else if(c==EOF)return 0;
		for (x = 0; c &lt;= &#x27;9&#x27; &amp;&amp; c &gt;= &#x27;0&#x27;; c = gc()) x = x * 10 + (c &amp; 15); x *= f;
		return 1;
	}

	inline bool read (long long &amp;x) {
		for (f = 1, c = gc(); c &lt; &#x27;0&#x27; || c &gt; &#x27;9&#x27;; c = gc()) if (c == &#x27;-&#x27;) f = -1;else if(c==EOF)return 0;
		for (x = 0; c &lt;= &#x27;9&#x27; &amp;&amp; c &gt;= &#x27;0&#x27;; c = gc()) x = x * 10 + (c &amp; 15); x *= f;
		return 1;
	}
	inline bool read (char &amp;x) {
		x=gc();
		return x!=EOF;
	}
	inline bool read(char *x){
		while((*x=gc())==&#x27;\n&#x27; || *x==&#x27; &#x27;||*x==&#x27;\r&#x27;)if(*x==EOF)return 0;
		while(!(*x==&#x27;\n&#x27;||*x==&#x27; &#x27;||*x==&#x27;\r&#x27;))*(++x)=gc();
		*x=0;
		return 1;
	}
	template&lt;typename A,typename ...B&gt;
	inline bool read(A &amp;x,B &amp;...y){
		return read(x)&amp;&amp;read(y...);
	}
	// print a signed integer
	inline bool write (signed x) {
		if (!x) putc (&#x27;0&#x27;); if (x &lt; 0) putc (&#x27;-&#x27;), x = -x;
		while (x) qu[++ qr] = x % 10 + &#x27;0&#x27;,  x /= 10;
		while (qr) putc (qu[qr --]);
		return 0;
	}

	inline bool write (long long x) {
		if (!x) putc (&#x27;0&#x27;); if (x &lt; 0) putc (&#x27;-&#x27;), x = -x;
		while (x) qu[++ qr] = x % 10 + &#x27;0&#x27;,  x /= 10;
		while (qr) putc (qu[qr --]);
		return 0;
	}
	inline bool write (char x) {
		putc(x);
		return 0;
	}
	inline bool write(const char *x){
		while(*x){putc(*x);++x;}
		return 0;
	}
	inline bool write(char *x){
		while(*x){putc(*x);++x;}
		return 0;
	}
	template&lt;typename A,typename ...B&gt;
	inline bool write(A x,B ...y){
		return write(x)||write(y...);
	}
	//no need to call flush at the end manually!
	struct Flusher_ {~Flusher_(){flush();}}io_flusher_;
}
using io :: read;
using io :: putc;
using io :: write;
int x[200005],y[200005],p[200005],q[200005];
int f[200005],ans;
vector&lt;pii&gt; st[1005],ed[1005];
struct DP{
	deque&lt;pii&gt; q;
	void insert(pii a){
		while(q.size()&gt;1 &amp;&amp; (a.y-q[0].y)*(a.x-q[1].x)&lt;=(a.y-q[1].y)*(a.x-q[0].x))q.pop_front();
		q.push_front(a);
	}
	int query(int w){
		int t=q.size();
		while(t&gt;1 &amp;&amp; (q[t-2].y-q[t-1].y)&lt;=(q[t-2].x-q[t-1].x)*w){--t;q.pop_back();}
		if(q.size()){
			return q.back().x*w-q.back().y;
		}
		else return -inf;

	}
};
DP dp[100005];
signed main(){
        int n,m,a,b,c;
	read(n,m,a,b,c);
	ed[0].push_back(make_pair(1,0));
	for(int i=1;i&lt;=m;++i){
		read(x[i],y[i],p[i],q[i]);
		st[p[i]].push_back(make_pair(x[i],i));
		ed[q[i]].push_back(make_pair(y[i],i));
	}
	ans=inf;
	for(int i=0;i&lt;=1000;++i){
		for(auto j:ed[i])if(f[j.y]&lt;(ll)inf){
			
			dp[j.x].insert(make_pair(i,a*i*i+f[j.y]-b*i));
//			write(j.x,&quot;pushed&quot;,i,&#x27; &#x27;,a*i*i+f[j.y]-b*i,&#x27;\n&#x27;);
			if(j.x==n){
//				write(i,&#x27; &#x27;,j.x,&#x27; &#x27;,&#x27; &#x27;,j.y,&#x27; &#x27;,f[j.y],&#x27;\n&#x27;);
				chkmin(ans,f[j.y]+i);
			}
		}
		for(auto j:st[i]){
			f[j.y]=a*i*i+b*i+c-dp[j.x].query(2*a*i);
//			write(x[j.x],&#x27; &#x27;,y[j.x],&#x27; &#x27;,j.y,&#x27; &#x27;,f[j.y],&#x27;\n&#x27;);
		}
	}
	write(ans,&#x27;\n&#x27;);
	return 0;
}
</code></pre>
				<br />
				
				<label for="result"> 评测结果 </label><div class="row"><div class="col-xs-12"><div class="alert alert-danger"><div class="text-center row"><table class="table table-borderless" style="margin:0px"><tr><td class="col-xs-2" style="vertical-align:middle;padding-left:20px;padding-right:20px"><b>Compilation</b></td><td class="col-xs-2" style="vertical-align:middle">N/A</td><td class="col-xs-2" style="vertical-align:middle">N/A</td><td class="col-xs-2" style="vertical-align:middle">Compile Error</td><td class="col-xs-2" style="vertical-align:middle">Score: N/A</td><td class="col-xs-2" style="vertical-align:middle"><a data-toggle="collapse" href="#detail_1" aria-expanded="false" aria-controls="detail_1">显示更多</a></td></tr></table></div><div class="collapse" id="detail_1"><br /><textarea class="form-control" style="background-color: white" rows="8" readonly>Compiling...
Contestant compile error
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:124:16: warning: integer constant is too large for its type
   else return -inf;
                ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:138:6: warning: integer constant is too large for its type
  ans=inf;
      ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:140:34: warning: integer constant is too large for its type
   for(auto j:ed[i])if(f[j.y]&lt;(ll)inf){
                                  ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:69:31: warning: variadic templates only available with -std=c++11 or -std=gnu++11
  template&lt;typename A,typename ...B&gt;
                               ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:15:11: warning: variadic templates only available with -std=c++11 or -std=gnu++11
 #define y second
           ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:70:30: note: in expansion of macro ‘y’
  inline bool read(A &amp;x,B &amp;...y){
                              ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:99:31: warning: variadic templates only available with -std=c++11 or -std=gnu++11
  template&lt;typename A,typename ...B&gt;
                               ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:15:11: warning: variadic templates only available with -std=c++11 or -std=gnu++11
 #define y second
           ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:100:29: note: in expansion of macro ‘y’
  inline bool write(A x,B ...y){
                             ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp: In function ‘int main()’:
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:140:12: error: ‘j’ does not name a type
   for(auto j:ed[i])if(f[j.y]&lt;(ll)inf){
            ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:149:3: error: expected ‘;’ before ‘for’
   for(auto j:st[i]){
   ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:149:3: error: expected primary-expression before ‘for’
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:149:3: error: expected ‘;’ before ‘for’
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:149:3: error: expected primary-expression before ‘for’
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:149:3: error: expected ‘)’ before ‘for’
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:149:12: error: ‘j’ does not name a type
   for(auto j:st[i]){
            ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:153:2: error: expected ‘;’ before ‘}’ token
  }
  ^
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:153:2: error: expected primary-expression before ‘}’ token
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:153:2: error: expected ‘;’ before ‘}’ token
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:153:2: error: expected primary-expression before ‘}’ token
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:153:2: error: expected ‘)’ before ‘}’ token
jp_data/tasks/358715eca7a911e9899e00163e04388b/contestant.cpp:153:2: error: expected primary-expression before ‘}’ token
</textarea></div></div></div></div>
			</div>
		</div>
	</div>

	<hr />
	
	<div class="row">
		<p style="text-align: center; color: #888">
			Judge Duck Online | 评测鸭在线 <br />
			Server Time: 2019-08-02 17:15:13 | Loaded in 1 ms | <a href="/status/index.html"> Server Status </a> <br />
			个人娱乐项目，仅供学习交流使用
		</p>
	</div>
</div>

</body>

</html>
